Be sure that you have a debugger installed on the machine that you run these on, because any errors cause calls to the debugger. If you don't have a debugger, you will get an "Unimplemented A-Trap" if any sort of an error occurs. You may use Macsbug, Jasik's Debugger, TMON, etc.
The source is included to the text editor. We plan to distribute the source free of charge, but please don't distribute this yet. I want to add some more stuff, and fix some bugs.
Double-click "IAC Spell Test". Then drag "testtext" onto the "Writeswell Jr." icon. Select "Get New Batch Service" from Writeswell Jr.'s menu. Select the speller in the browser. This adds "Check Spelling with IAC Spell Test" to the Services Menu. Then you can use this menu item to check spelling. After this initial setup the menu item will launch the speller whether it is running in the background or not, making it invisible to the user that the speller is not a built-in menu item.
Position the speller's window so you can see the text in Writeswell Jr., and hit skip or replace as you like.
The technique that I use for handling Apple Events is the "Object First Approach" described by Richard Clark in the May, 1992 issue of d e v e l o p, in the article "Apple Event Objects and You."
I call this an "inverted" handling method myself in the code. I resolve the object specifier first (in a wildcard handler), and then pass the token to a dispatcher that calls the functions to actually do the event. The "normal" way to do it is to install a handler for each event, resolve the object specifier, and then call code to do the event for each type. The object first approach allows new data types to be added in a simpler manner.
I highly recommend reading Richard's article while studying this code.
The Object Support Library on this disk is converted from the MPW OSL using the ThinkC "oConv" utility. If you want to do the conversion yourself, use the vocabulary file in the Apple Libraries folder. If you convert without using the vocabulary file, the OSL function names will all be uppercase.
Enjoy!
Mike Crawford
Working Software, Inc.
AppleLink D1620
Compuserve 76004,2072
Change History:
1.0d5
Changed the name of the text editor to "Writeswell Jr."
Changed services menu to get menu strings from the speller. Selecting the speller's item will launch the speller if it is not already running.
Added the preferences file.
Made the window resizable and scrollable.
Made the speller respond immediately to batch events so it can respond when launched by the editor. Before, it needed a couple null events before it would start responding to batch events.
1.0d3
Changed the icons
Fixed some bugs in the speller that would cause out of memory errors (these were in the speller code itself, and not the IAC stuff)